package com.edgar.log4j.appender;

import org.apache.log4j.Logger;

public class FileBasedLogginDemo implements Runnable {

	private static Logger logger = Logger.getLogger(FileBasedLogginDemo.class
			.getPackage().getName());

	public void doLogging() {
		Thread t = new Thread(this);
		t.start();
	}

	@Override
	public void run() {
		int count = 1;
		while (true) {
			try {
				logger.debug("Logging the infomation..." + count);
				Thread.sleep(60);
				count++;
			} catch (Exception e) {
				logger.warn("Exception occurred", e);
			}
		}
	}
	
	public static void main(String[] args) {
		FileBasedLogginDemo demo = new FileBasedLogginDemo();
		demo.doLogging();
	}
}
